home *** CD-ROM | disk | FTP | other *** search
Text File | 1989-11-17 | 3.5 KB | 175 lines | [TEXT/MPS ] |
- //
- // CTBUtils.h
- // C interface to the Communications Toolbox Utilities
- //
- // Copyright © Apple Computer, Inc. 1988, 1989
- // All rights reserved.
- //
- //
-
- #ifndef __CTBUTILS__
- #define __CTBUTILS__
-
- #ifndef __MEMORY__
- #include <Memory.h>
- #endif
-
- #ifndef __PACKAGES__
- #include <Packages.h>
- #endif
-
- #ifndef __APPLETALK__
- #include <AppleTalk.h>
- #endif
-
- // version of Comm Toolbox Utilities
- #define curCTBUVersion 1
-
- // Error codes/types
- typedef OSErr CTBUErr;
-
- #define ctbuGenericError -1
- #define ctbuNoErr 0
-
- // Dialog Item List Manipulation Constants
- typedef short DITLMethod;
- enum {
- overlayDITL,
- appendDITLRight,
- appendDITLBottom
- };
-
- // Choose return codes
- enum {
- chooseDisaster = -2,
- chooseFailed,
- chooseAborted,
- chooseOKMinor,
- chooseOKMajor,
- chooseCancel
- };
-
- // NuLookup return codes
- enum {
- nlOk,
- nlCancel,
- nlEject
- };
-
- // Name filter proc return codes
- enum {
- nameInclude = 1,
- nameDisable,
- nameReject
- };
-
- // Zone filter proc return codes
- enum {
- zoneInclude = 1,
- zoneDisable,
- zoneReject
- };
-
- // Values for hookProc items
- #define hookOK 1
- #define hookCancel 2
- #define hookOutline 3
- #define hookTitle 4
- #define hookItemList 5
- #define hookZoneTitle 6
- #define hookZoneList 7
- #define hookLine 8
- #define hookVersion 9
- #define hookReserved1 10
- #define hookReserved2 11
- #define hookReserved3 12
- #define hookReserved4 13
- // "virtual" hookProc items
- #define hookNull 100
- #define hookItemRefresh 101
- #define hookZoneRefresh 102
- #define hookEject 103
- #define hookPreflight 104
- #define hookPostflight 105
- #define hookKeyBase 1000
-
-
- // Popup Menu CDEF constants
- #define popupMenuCDEFproc 1008
-
- // Popup Control Variation Codes
- enum {
- popupFixedWidth = 1 << 0,
- popupUseCQD = 1 << 1,
- popupUseAddResMenu = 1 << 2,
- popupUseWFont = 1 << 3
- };
-
- // Popup Title Characteristics
- enum {
- popupTitleBold = 1 << 8,
- popupTitleItalic = 1 << 9,
- popupTitleUnderline = 1 << 10,
- popupTitleOutline = 1 << 11,
- popupTitleShadow = 1 << 12,
- popupTitleCondense = 1 << 13,
- popupTitleExtend = 1 << 14,
- popupTitleNoStyle = 1 << 15
-
- };
- #define popupTitleLeftJust 0x0000
- #define popupTitleCenterJust 0x0001
- #define popupTitleRightJust 0x00FF
-
-
- // NuLookup structures/constants
- struct NLTypeEntry {
- Handle hIcon;
- Str32 typeStr;
- };
-
- #ifndef __cplusplus
- typedef struct NLTypeEntry NLTypeEntry;
- #endif
-
- typedef NLTypeEntry NLType[4];
-
- struct LookupReply {
- EntityName theEntity;
- AddrBlock theAddr;
- };
-
- #ifndef __cplusplus
- typedef struct LookupReply LookupReply;
- #endif
-
- typedef pascal short (*nameFilterProcPtr)(EntityName theEntity);
- typedef pascal short (*zoneFilterProcPtr)(Str32 theZone);
-
- #ifdef __safe_link
- extern "C" {
- #endif
- extern pascal CTBUErr InitCTBUtilities(void);
- extern pascal short CTBGetCTBVersion(void);
-
- extern pascal void AppendDITL(DialogPtr theDialog, Handle theHandle, DITLMethod method);
- extern pascal short CountDITL(DialogPtr theDialog);
- extern pascal void ShortenDITL(DialogPtr theDialog, short numberItems);
-
- extern pascal short NuLookup(Point where, const Str255 prompt, short numTypes,
- NLType typeList, nameFilterProcPtr nameFilter,
- zoneFilterProcPtr zoneFilter, DlgHookProcPtr hookProc,
- LookupReply *theReply);
-
- extern pascal short NuPLookup(Point where, const Str255 prompt, short numTypes,
- NLType typeList, nameFilterProcPtr nameFilter,
- zoneFilterProcPtr zoneFilter, DlgHookProcPtr hookProc,
- long userData, short dialogID,
- ModalFilterProcPtr filterProc,
- LookupReply *theReply);
-
- #ifdef __safe_link
- }
- #endif
-
- #endif __CTBUTILS__